|
Like in other object oriented languages class types can be abstract. This property is defined by the keyword abstract in the class type declaration. An abstract class type doesn't need to implement any of the methods which are declared in the interface. That is why abstract class types can't be instantiated. Abstract classes are mostly used to define a common interface for a class hierarchy. This technique is often used with polymorphism (see Chapter 5.3). Inheritance with class types is restricted only to single inheritance. That means a derived class can inherit only from one parent. Multiple inheritance raises a lot of problems and can often be emulated by other object oriented techniques like delegation to an aggregated object. |
|